From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty@averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty@averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root@skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty@averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty@averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis@baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:43 2006 Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj@linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj@www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis@baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty@averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty@averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root@skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty@averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty@averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis@baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:02 2006 Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj@linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj@www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis@baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty@averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty@averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root@skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty@averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty@averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis@baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:03 2006 Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj@linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj@www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis@baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building > > both > > RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the > HP > > build. > > > > The hardware configuration of our HPUX cluster is a two rp2470 node > system, > > each > > with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java > > 1.4.1_01 > > downloaded from HP. > > > > Regards > > Chris > > > > Chris Avis > > WAPS CADCOM Project > > <<...OLE_Obj...>> > > PO Box 1755 Midland WA 6936 > > Phone 9374 8617 > > Fax 9374 8666 > > Mobile 0408 244 734 > > Email chris.avis at baesystems.com > > > > > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > > > From redirectz at yahoo.es Tue Jun 3 05:48:44 2003 From: redirectz at yahoo.es (redirectz) Date: 03 Jun 2003 06:48:44 -0500 Subject: [Rxtx] problem using parallel port Message-ID: <1054640935.1138.5.camel@localhost.localdomain> Hi friends... Please. I want to use my parrallel port using java, I'm using rxtx 2.6-1, but I have a problem with send/receive data using parallel port (i'm forgetting something)... I made two classes, one to send and the other to receive... I hope don't look like a folish if paste my code but i'm desperate CLASS FOR RECEIVE DATA -- BEGIN OF CLASS---------------------------------------------- package miParalelo; import java.io.*; import java.util.*; import gnu.io.*; public class pReceptor implements Runnable { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; Thread readThread; public pReceptor() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("myReader", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); } catch (IOException e) {} readThread = new Thread(this); readThread.start(); } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pReceptor(); } } public void run() { boolean salida = false; byte[] laSalida = new byte[100]; while( !salida ) { try { while (inputStream.available() > 0) { int leidos = inputStream.read( laSalida ); } System.out.println(new String(laSalida) ); salida = true; } catch (IOException e) {} try { Thread.sleep(1000); }catch (InterruptedException e) {} } } } -- END OF CLASS---------------------------------------- And now my class to send data... the more rare thing is that when run this class -> it never finish CLASS FOR SEND DATA -- BEGIN OF CLASS---------------------------------------------- public class pEnviador { static CommPortIdentifier portId; static Enumeration portList; ParallelPort parallelPort; InputStream inputStream; OutputStream outputStream; static String myMessage="pepo"; public pEnviador() { System.out.println("it is alive"); try { parallelPort = (ParallelPort) portId.open("MyApp", 2000); } catch (PortInUseException e) {} try { inputStream = parallelPort.getInputStream(); outputStream = parallelPort.getOutputStream(); } catch (IOException e) {} try { //outputStream.write( myMessage.getBytes() ); byte myData = 1; outputStream.write( myData ); } catch (IOException e) {} } public static void main(String[] args) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) if (portId.getName().equals("/dev/lp0")) new pEnviador(); } System.out.println("I never see this line"); } } -- END OFCLASS---------------------------------------- From rwelty at averillpark.net Tue Jun 3 06:37:49 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: i built RXTX 2.1.6 a couple of months ago and had all kinds of ./configure and makefile glitches, which i worked through by hand editing the makefile. now i need to recompile and reinstall (upgraded to jdk 1.4.1_02 from 1.4.1_01), and i'm revisiting those issues. what is the proper setup to get this to go correctly? what i have right now is as follows, which works for most things but not for building RXTX: JDK_HOME=/usr/java/j2sdk1.4.1_02 JAVA_HOME=${JDK_HOME}/jre JAVA_LOCAL=/usr/local/java CLASSPATH=${JAVA_HOME}/lib/rt.jar:${JAVA_LOCAL}/lib/pgjdbc2.jar LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${JAVA_HOME}/lib:${JAVA_LOCAL}/lib export JDK_HOME JAVA_HOME CLASSPATH LD_LIBRARY_PATH JAVA_LOCAL it appears things are crossed between what is in $JDK_HOME and what is in $JAVA_HOME and i've yet to find an arrangement that works well. thanks, richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From jj_public at yahoo.ca Tue Jun 3 07:14:02 2003 From: jj_public at yahoo.ca (JJ) Date: Tue, 3 Jun 2003 10:44:02 -0230 Subject: [Rxtx] problem using parallel port In-Reply-To: <1054640935.1138.5.camel@localhost.localdomain> References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: <200306031044.02068.jj_public@yahoo.ca> On June 3, 2003 9:18 am, redirectz wrote: > Hi friends... > And now my class to send data... the more rare thing is that when run > this class -> it never finish Make sure you close your port before ending the program. If you don't close it, the program will not terminate. Of course, you can always force it to terminate with System.exit(0); but if you close everything down, you shouldn't have to. Hope this helps! From rwelty at averillpark.net Tue Jun 3 08:12:24 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty wrote: > JDK_HOME=/usr/java/j2sdk1.4.1_02 > JAVA_HOME=${JDK_HOME}/jre > JAVA_LOCAL=/usr/local/java some further commentary based on my current experiences: RXTX seems to want to install in the jre lib directories. this turns out to be bad when you do, for example, an rpm based upgrade of Sun's JDK, as the rpm upgrade process cheerfully nukes the previous lib directory and gets rid of all the files RXTX installs there. i don't know if there's a standard place to put local java files outside the jdk/jre tree, i normally set up /usr/local/java (per the enviroment variable setups i give above.) richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:31:37 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 10:12:24 -0400 (EDT) Richard Welty wrote: > On Tue, 3 Jun 2003 08:37:49 -0400 (EDT) Richard Welty > wrote: > > JDK_HOME=/usr/java/j2sdk1.4.1_02 > > JAVA_HOME=${JDK_HOME}/jre > > JAVA_LOCAL=/usr/local/java > > some further commentary based on my current experiences: > > RXTX seems to want to install in the jre lib directories. this turns out > to > be bad when you do, for example, an rpm based upgrade of Sun's JDK, as > the > rpm upgrade process cheerfully nukes the previous lib directory and gets > rid of all the files RXTX installs there. in further attempting to hack through this, i decided to play with the make file again. the following changes allowed javac and the like to be found (with a but that comes later in this email message): [root at skipper rxtx-2.1-6]# diff Makefile Makefile.generated 116,119c116,119 < JAR = $(JSDKPATH)/bin/jar < JAVAC = $(JSDKPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O < JAVADOC = $(JSDKPATH)/bin/javadoc < JAVAH = $(JSDKPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni --- > JAR = $(JPATH)/bin/jar > JAVAC = $(JPATH)/bin/javac -classpath $(CLASSPATH) -d $(TOP)/ -O > JAVADOC = $(JPATH)/bin/javadoc > JAVAH = $(JPATH)/bin/javah -classpath $(CLASSPATH) -d $(DEST) -jni 122c122 < JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/include --- > JAVAINCLUDEDIR = /usr/java/j2sdk1.4.1_02/jre/include 131d130 < JSDKPATH = /usr/java/j2sdk1.4.1_02/ however, now there's a problem with the include directory in j2sdk 1.4.1_02: In file included from gnu_io_RXTXPort.h:2, from /tools/rxtx/rxtx-2.1-6/src/SerialImp.c:23: /usr/java/j2sdk1.4.1_02/include/jni.h:27:20: jni_md.h: No such file or directory it turns out that jni_md.h is in the subdirectory include/linux in this particular distribution. i'm going to continue slashing and burning my way through this, probably by symlinking jni_md.h in one level up. but please tell me there's a better solution. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From rwelty at averillpark.net Tue Jun 3 09:49:19 2003 From: rwelty at averillpark.net (Richard Welty) Date: Tue, 3 Jun 2003 11:49:19 -0400 (EDT) Subject: [Rxtx] environment variable setup for RXTX build In-Reply-To: References: <1054640935.1138.5.camel@localhost.localdomain> Message-ID: On Tue, 3 Jun 2003 11:31:37 -0400 (EDT) Richard Welty wrote: > it turns out that jni_md.h is in the subdirectory include/linux in this > particular distribution. i'm going to continue slashing and burning my > way > through this, probably by symlinking jni_md.h in one level up. ok, that change got it to compile, now for the install glitch. from the makefile: RXTX_PATH = $(JPATH)/jre/lib/$(OS_ARCH) now the way things set up, JPATH already has jre/ in it, so this gets doubled and points at a non-existent directory. hand editing jre/ out of RXTX_PATH got it to finish. i subsequently moved the rxtx files over to /usr/local/java/lib so future java upgrades won't remove them automagically, and now it seems to be working ok. richard -- Richard Welty rwelty at averillpark.net Averill Park Networking 518-573-7592 Unix, Linux, IP Network Engineering, Security From chris.avis at baesystems.com Wed Jun 4 23:57:54 2003 From: chris.avis at baesystems.com (AVIS, Chris) Date: Thu, 5 Jun 2003 15:27:54 +0930 Subject: [Rxtx] HPUX 100% CPU Utilisation Message-ID: <41842F7B366BD611A8E100D0B7910EC20ED8B3@KENTFP1> We have recently moved a Serial application from a Windows 2000 box to our HPUX Cluster. We have used the new HPUX Java Communications API which is the HP build of RXTX 2.0-5. We have experienced a problem with the CPU utilisation running at 100% under HPUX. We have not experienced this problem under Windows 2000, and the problem exists even if no communications is occuring over the serial link. We have run Java with the -Xprof option and it appears to be spending more than 99.5% of the time in the native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on other HPUX systems? Is there a solution to this problem? We have tried building both RXTX 2.0-5 and 2.1-6 for ourselves with exactly the same behaviour as the HP build. The hardware configuration of our HPUX cluster is a two rp2470 node system, each with 2 CPUs and 3GB RAM per node running HPUX 11.0. We are running Java 1.4.1_01 downloaded from HP. Regards Chris Chris Avis WAPS CADCOM Project <<...OLE_Obj...>> PO Box 1755 Midland WA 6936 Phone 9374 8617 Fax 9374 8666 Mobile 0408 244 734 Email chris.avis at baesystems.com From allan at data-house.com Tue Jun 3 09:04:14 2003 From: allan at data-house.com (K. Allan Wilson) Date: 03 Jun 2003 10:04:14 -0500 Subject: [Rxtx] lock file question Message-ID: <1054652655.2035.6.camel@allanxp> Hopefully this is an easy question. I am getting the following warning message: RXTX Warning: Removing stale lock file. Although this warning comes up on the display it does not cause a problem. I do not want the user to be able to see this error message so I need to either fix the problem or supress error messages from going to standard out. Any idea? Allan Wilson From jj_public at yahoo.ca Sat Jun 7 08:43:05 2003 From: jj_public at yahoo.ca (JJ) Date: Sat, 7 Jun 2003 12:13:05 -0230 Subject: [Rxtx] lock file question References: <1054652655.2035.6.camel@allanxp> Message-ID: <000801c32d03$1b897190$0f00a8c0@taz> In Linux, if you don't need any output to appear you can pipe it to a file program >> filename.txt 2>&1 or alternatively, you can pipe it to /dev/null ----- Original Message ----- From: "K. Allan Wilson" To: Sent: Tuesday, June 03, 2003 12:34 PM Subject: [Rxtx] lock file question > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 09:21:08 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 16:21:08 +0100 (BST) Subject: [Rxtx] lock file question In-Reply-To: <1054652655.2035.6.camel@allanxp> References: <1054652655.2035.6.camel@allanxp> Message-ID: The error message is informative and will not be removed from rxtx. The previous application (possibly yours) did not remove the lock file before exiting. I suspect if you close the port before exiting the message will go away. Closing the port will remove your lock file. There is a (very bad) option in rxtx configure to remove lock file support on Unix if you do not like the messages. It is my understanding that SUSE has recently moved its lock file location. This suggests that the FHS has suggested a new location. I've not had time to review SUSE's action but rxtx will continue to support the FHS and cause problems on non compliant systems unless a more suitable standard is found. http://www.pathname.com/fhs/2.2/fhs-5.9.html On Tue, 3 Jun 2003, K. Allan Wilson wrote: > Hopefully this is an easy question. I am getting the following warning > message: > > RXTX Warning: Removing stale lock file. > > Although this warning comes up on the display it does not cause a > problem. I do not want the user to be able to see this error message so > I need to either fix the problem or supress error messages from going to > standard out. Any idea? > > Allan Wilson > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sat Jun 7 10:44:11 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Sat, 7 Jun 2003 17:44:11 +0100 (BST) Subject: [Rxtx] jcl.jar import for javax.comm missing? In-Reply-To: <3EDA3F91.8070809@dunlops.com> References: <20030530190310.92561.qmail@web14204.mail.yahoo.com> <3EDA3F91.8070809@dunlops.com> Message-ID: This would be a mistake if true. For most uses, rxtx-2.0-5 should be ok. I'll be releasing 2.0 and 2.1 this comming week. rxtx 2.0 is essentially a subset of 2.1 with packages modified to work with Sun's commapi and a small license change for HP. Most testing happens with 2.1 and then the packages are modified for 2.0. It sounds like I missed something in that prerelease. On Sun, 1 Jun 2003, Michael Andreasen wrote: > I am using rxtx with the standard javax.comm.* packages, however I'm > getting a problem. I have downloaded the latest 2.0 files (the ones for > java.comm, right?) from here; > > http://www.frii.com/~jarvi/rxtx//download/prerelease/2.0/ > > I was getting strange "class not found" exceptions, so I disassembled > the class files in the jcl.jar archive. The problem appear to be that > these class files have not been compiled with imports for javax.comm, so > it is trying to find CommDriver in gnu.io instead of javax.comm. > Obviously, this is not right for the javax.comm implementation. > > Cheers, Michael. > > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://undine.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Sun Jun 8 23:18:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Mon, 9 Jun 2003 06:18:44 +0100 (BST) Subject: [Rxtx] HPUX 100% CPU Utilisation In-Reply-To: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> References: <41842F7B366BD611A8E100D0B7910EC20ED8C9@KENTFP1> Message-ID: Hi Chris, Let's hope we can get ssh access to a box. HP owes rxtx big time for making a LGPL modification for them in rxtx 2.0 free of charge and hassle. Don't be afraid to remind them of that. I could have forced them to pay for an HP box at the time but just did the right thing as they should now. It is not easy to know whats going on. The one thing I may suggest is replacing the usleep with a sleep. The eventLoop should be fairly intuitive without digging into the called functions below it. Just try to put the brakes on it with some sleeps. If you go beyond 10 ms bad things will start to happen but 1 ms should make the problem all but go away. Maybe that select() is not doing what I expect? Are you sitting with unread data? If this is really critical you could always use a pc and tcp/ip to get the data where it needs to go... I've cc'd Cathrine who did the original HP-UX port (great gal). I've also cc'd Awais who was involved in the more official HP/rxtx 2.0.5 port/license modifications. Cathrine's work was what encouraged me to help HP with the license issues. Thats about all I can think of to help you at this point. Feel free to forward this email to your HP contacts also. On Mon, 9 Jun 2003, AVIS, Chris wrote: > Trent, > > hopefully you have read my previous email to HP and they will do the > decent thing and cough up a machine for you. > > Looks like we may have to go down the "blind" path for a while. I did > a grep on the code and there are a few occurences of usleep in SerialImp.c > but none appear to be compiled out under any non Sun architecture including > HP. Any suggestions? > > Regards > Chris > > Chris Avis > WAPS CADCOM Project > > PO Box 1755 Midland WA 6936 > Phone 9374 8617 > Fax 9374 8666 > > > > > -----Original Message----- > From: Trent Jarvi [mailto:taj at linuxgrrls.org] > Sent: Saturday, 7 June 2003 23:16 > To: AVIS, Chris > Subject: Re: [Rxtx] HPUX 100% CPU Utilisation > > > > > Hi Chris: > > Is it possible that I could get access to this machine to see whats going > on? > > I can try helping in a blind remote fashion but the faster way will be to > try/test event loop modifications on HP. > > I'm guessing a sleep (up to 10 ms would be typically OK) is just being > compiled out on HP. Not having access to an HP box is the limiting factor > for HP development from this end. > > Trent Jarvi > Maintainer www.rxtx.org > taj at www.linux.org.uk > > On Thu, 5 Jun 2003, AVIS, Chris wrote: > > > We have recently moved a Serial application from a Windows 2000 box to our > > HPUX Cluster. We have used the new HPUX Java Communications API which is > > the HP build of RXTX 2.0-5. > > > > We have experienced a problem with the CPU utilisation running at 100% > under > > HPUX. We have not experienced this problem under Windows 2000, and the > > problem > > exists even if no communications is occuring over the serial link. We have > > run Java > > with the -Xprof option and it appears to be spending more than 99.5% of > the > > time in the > > native method gnu.io.RXTXPort.eventLoop. Has anyone seen this behaviour on > > other > > HPUX systems? Is there a solution to this problem? We have tried building